d={'hello':10,'world':20,'python':30,'php':40}
print(d)
d['java']=50#添加元素
print(d)

# 获取所有的键
print(d.keys())
print(list(d.keys()))
print(tuple(d.keys()))
# 获取所有的值
print(d.values())
print(list(d.values()))
print(tuple(d.values()))

# 将字典中的数据转成键值对key-value的形式
lst=list(d.items())
print(lst)
d1=dict(lst)
print(d1)

# 使用pop函数，先取出值value在再删除字典中对应的键值对
print(d.pop('hello'))
print(d)
# 随机删除popitem
print(d.popitem())
print(d)

# 清空clear
d.clear()
print(d)


print(bool({}))#False
print(bool([]))#False
print(bool(()))#False
print(bool(set()))
